package cn.yuanqiao.archive.detection.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 配置项对象 YQ_FN_DETECTION_OBJ_ITEM
 *
 * @author xy
 * @date 2023-08-08
 */
public class DetectionItem extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    public static final String BIGTABLENAME = "_YQ_FN_DETECTION_OBJ_ITEM";

    public DetectionItem() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
          //  throw new ServiceException("tenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }

    /** id */
    @IdAnnotation
    private Long id;

    /** 配置内容Id */
    @Excel(name = "配置内容Id")
    private Long objId;

    /** 名称 */
    @Excel(name = "名称")
    private String name;

    /** 值 */
    @Excel(name = "值")
    private String value;

    /** 值 */
    @Excel(name = "值")
    private String price;

    /** 类型 */
    @Excel(name = "类型")
    private String type;

    /** 创建人ID */
    @Excel(name = "创建人ID")
    private Long createId;

    private String tableName;

    private String style;

    private String fieldName;

    private String fieldCaption;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setObjId(Long objId)
    {
        this.objId = objId;
    }

    public Long getObjId()
    {
        return objId;
    }
    public void setName(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }
    public void setValue(String value)
    {
        this.value = value;
    }

    public String getValue()
    {
        return value;
    }
    public void setPrice(String price)
    {
        this.price = price;
    }

    public String getPrice()
    {
        return price;
    }
    public void setType(String type)
    {
        this.type = type;
    }

    public String getType()
    {
        return type;
    }
    public void setCreateId(Long createId)
    {
        this.createId = createId;
    }

    public Long getCreateId()
    {
        return createId;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getFieldCaption() {
        return fieldCaption;
    }

    public void setFieldCaption(String fieldCaption) {
        this.fieldCaption = fieldCaption;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("objId", getObjId())
            .append("name", getName())
            .append("value", getValue())
            .append("price", getPrice())
            .append("type", getType())
            .append("createId", getCreateId())
            .append("createTime", getCreateTime())
            .toString();
    }
}
